<template>
  <div class="demo-index">
    <ep-radio-group v-model="active" style="margin-bottom: 20px">
      <ep-radio-button label="页面Demo"></ep-radio-button>
      <ep-radio-button label="相关内置方法"></ep-radio-button>
      <ep-radio-button label="chunk组件new"></ep-radio-button>
      <ep-radio-button label="chunk组件old"></ep-radio-button>
    </ep-radio-group>
    <component :is="cpt" />
  </div>
</template>

<script>
import pageDemo from './page'
import appFnDemo from './appFn'
import chunkDemo from './chunkDemo'
import chunkDemoNew from './chunkDemoNew'

export default {
  name: 'demo-index',
  data() {
    return {
      active: '页面Demo'
    }
  },
  computed: {
    cpt() {
      return {
        页面Demo: pageDemo,
        相关内置方法: appFnDemo,
        chunk组件old: chunkDemo,
        chunk组件new: chunkDemoNew
      }[this.active]
    }
  },
  mounted() {
    console.log('mounted')
  }
}
</script>
<style lang="less" scoped>
.demo-index {
}
</style>
